package com.jianghu.helpers;

import android.content.Context;
import android.content.Intent;

import com.jianghu.FirstPage;

public class ExitProcess {

	public static final int EXIT_APPLICATION = 0x0001;
	private Context mContext;

	public ExitProcess(Context context) {
		this.mContext = context;
	}

	public void exit() {

		// ActivityManager am = (ActivityManager)
		// mContext.getSystemService(Context.ACTIVITY_SERVICE);
		// am.restartPackage(mContext.getPackageName());

		Intent mIntent = new Intent();
		mIntent.setClass(mContext, FirstPage.class);
		mIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		mIntent.putExtra("flag", EXIT_APPLICATION);
		mContext.startActivity(mIntent);
	}

}
